<?php ob_start();?>
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include($root.'/standart/head.php');
include($root.'/standart/dateHeader.php');
include($root.'/standart/checkUser.php');
$db = connect();
$stmt ="SELECT ID, EVENT_TITLE, EVENT_DEFINITION, EVENT_DATE, START_TIME, END_TIME, EVENT_IMAGE
		FROM EVENTS
		WHERE EVENT_DATE > CURRENT_DATE()";
$res = $db->query($stmt) or die($stmt."<br/><br/>".mysql_error());
	?>
	<table class="table table-striped table-bordered table-hover" id="dataTables-example">
		<thead>
        	<tr>
                <th nowrap="nowrap">Etkinlik Başlığı</th>
                <th nowrap="nowrap">Açıklama</th>
                <th nowrap="nowrap">Etkinlik Tarihi</th>
                <th style="display: none;">ID</th>
                <th style="display: none;">Image</th>
            </tr>
		</thead>
        <tbody>
        <?php $odd = true; ?>
       	<?php while($row = $res->fetch_assoc()){?>
        	<tr class="<?php echo $odd ? "odd" : "even";?> " style="cursor: pointer;">
	            <td><?php echo $row["EVENT_TITLE"];?></td>
                <td><?php echo $row["EVENT_DEFINITION"];?></td>
                <td><?php echo date("d/m/Y",strtotime($row["EVENT_DATE"])).' '.$row["START_TIME"].'/'.$row["END_TIME"];?></td>
                <td style="display: none;"><?php echo $row["ID"];?></td>
                <td style="display: none;"><?php echo $row["EVENT_IMAGE"];?></td>
			</tr>
			<?php $odd = !$odd;?>
		<?php }?>
		</tbody>
     </table>
	<?php 
$res->close();
disconnect($db);
?>
<?php ob_end_flush(); ?>